<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      :  Distribution.Simple.Bench</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Copyright   :  Johan Tibell 2011</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  BSD3</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  cabal-devel@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- This is the entry point into running the benchmarks in a built</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- package. It performs the \&quot;@.\/setup bench@\&quot; action. It runs</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- benchmarks designated in the package description.</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Simple.Bench</span><span>
</span><span id="line-18"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Distribution.Simple.Bench.html#bench"><span class="hs-identifier">bench</span></a></span><span>
</span><span id="line-19"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.UnqualComponentName.html"><span class="hs-identifier">Distribution.Types.UnqualComponentName</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.html"><span class="hs-identifier">Distribution.PackageDescription</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">PD</span></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.BuildPaths.html"><span class="hs-identifier">Distribution.Simple.BuildPaths</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Compiler.html"><span class="hs-identifier">Distribution.Simple.Compiler</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.InstallDirs.html"><span class="hs-identifier">Distribution.Simple.InstallDirs</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Simple.LocalBuildInfo.html"><span class="hs-identifier">Distribution.Simple.LocalBuildInfo</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LBI</span></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Setup.html"><span class="hs-identifier">Distribution.Simple.Setup</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.UserHooks.html"><span class="hs-identifier">Distribution.Simple.UserHooks</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html"><span class="hs-identifier">Distribution.Simple.Utils</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Pretty.html"><span class="hs-identifier">Distribution.Pretty</span></a></span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier">doesFileExist</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator">(&lt;/&gt;)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator">(&lt;.&gt;)</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-comment">-- | Perform the \&quot;@.\/setup bench@\&quot; action.</span><span>
</span><span id="line-39"></span><span class="annot"><a href="Distribution.Simple.Bench.html#bench"><span class="hs-identifier hs-type">bench</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.UserHooks.html#Args"><span class="hs-identifier hs-type">Args</span></a></span><span>                    </span><span class="hs-comment">-- ^positional command-line arguments</span><span>
</span><span id="line-40"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.PackageDescription.html#PackageDescription"><span class="hs-identifier hs-type">PD.PackageDescription</span></a></span><span>   </span><span class="hs-comment">-- ^information from the .cabal file</span><span>
</span><span id="line-41"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.LocalBuildInfo.html#LocalBuildInfo"><span class="hs-identifier hs-type">LBI.LocalBuildInfo</span></a></span><span>      </span><span class="hs-comment">-- ^information from the configure step</span><span>
</span><span id="line-42"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Setup.html#BenchmarkFlags"><span class="hs-identifier hs-type">BenchmarkFlags</span></a></span><span>          </span><span class="hs-comment">-- ^flags sent to benchmark</span><span>
</span><span id="line-43"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span id="bench"><span class="annot"><span class="annottext">bench :: Args
-&gt; PackageDescription -&gt; LocalBuildInfo -&gt; BenchmarkFlags -&gt; IO ()
</span><a href="Distribution.Simple.Bench.html#bench"><span class="hs-identifier hs-var hs-var">bench</span></a></span></span><span> </span><span id="local-6989586621679726606"><span class="annot"><span class="annottext">Args
</span><a href="#local-6989586621679726606"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621679726605"><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679726605"><span class="hs-identifier hs-var">pkg_descr</span></a></span></span><span> </span><span id="local-6989586621679726604"><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679726604"><span class="hs-identifier hs-var">lbi</span></a></span></span><span> </span><span id="local-6989586621679726603"><span class="annot"><span class="annottext">BenchmarkFlags
</span><a href="#local-6989586621679726603"><span class="hs-identifier hs-var">flags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-45"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679726600"><span class="annot"><span class="annottext">verbosity :: Verbosity
</span><a href="#local-6989586621679726600"><span class="hs-identifier hs-var hs-var">verbosity</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Flag Verbosity -&gt; Verbosity
forall a. WithCallStack (Flag a -&gt; a)
</span><a href="Distribution.Simple.Flag.html#fromFlag"><span class="hs-identifier hs-var">fromFlag</span></a></span><span> </span><span class="annot"><span class="annottext">(Flag Verbosity -&gt; Verbosity) -&gt; Flag Verbosity -&gt; Verbosity
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">BenchmarkFlags -&gt; Flag Verbosity
</span><a href="Distribution.Simple.Setup.html#benchmarkVerbosity"><span class="hs-identifier hs-var hs-var">benchmarkVerbosity</span></a></span><span> </span><span class="annot"><span class="annottext">BenchmarkFlags
</span><a href="#local-6989586621679726603"><span class="hs-identifier hs-var">flags</span></a></span><span>
</span><span id="line-46"></span><span>        </span><span id="local-6989586621679726597"><span class="annot"><span class="annottext">benchmarkNames :: Args
</span><a href="#local-6989586621679726597"><span class="hs-identifier hs-var hs-var">benchmarkNames</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Args
</span><a href="#local-6989586621679726606"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-47"></span><span>        </span><span id="local-6989586621679726596"><span class="annot"><span class="annottext">pkgBenchmarks :: [Benchmark]
</span><a href="#local-6989586621679726596"><span class="hs-identifier hs-var hs-var">pkgBenchmarks</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageDescription -&gt; [Benchmark]
</span><a href="Distribution.Types.PackageDescription.html#benchmarks"><span class="hs-identifier hs-var hs-var">PD.benchmarks</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679726605"><span class="hs-identifier hs-var">pkg_descr</span></a></span><span>
</span><span id="line-48"></span><span>        </span><span id="local-6989586621679726594"><span class="annot"><span class="annottext">enabledBenchmarks :: [Benchmark]
</span><a href="#local-6989586621679726594"><span class="hs-identifier hs-var hs-var">enabledBenchmarks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Benchmark, ComponentLocalBuildInfo) -&gt; Benchmark)
-&gt; [(Benchmark, ComponentLocalBuildInfo)] -&gt; [Benchmark]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Benchmark, ComponentLocalBuildInfo) -&gt; Benchmark
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageDescription
-&gt; LocalBuildInfo -&gt; [(Benchmark, ComponentLocalBuildInfo)]
</span><a href="Distribution.Simple.LocalBuildInfo.html#enabledBenchLBIs"><span class="hs-identifier hs-var">LBI.enabledBenchLBIs</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679726605"><span class="hs-identifier hs-var">pkg_descr</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679726604"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span>        </span><span class="hs-comment">-- Run the benchmark</span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><a href="#local-6989586621679726592"><span class="hs-identifier hs-type">doBench</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.Benchmark.html#Benchmark"><span class="hs-identifier hs-type">PD.Benchmark</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitCode"><span class="hs-identifier hs-type">ExitCode</span></a></span><span>
</span><span id="line-52"></span><span>        </span><span id="local-6989586621679726592"><span class="annot"><span class="annottext">doBench :: Benchmark -&gt; IO ExitCode
</span><a href="#local-6989586621679726592"><span class="hs-identifier hs-var hs-var">doBench</span></a></span></span><span> </span><span id="local-6989586621679726591"><span class="annot"><span class="annottext">Benchmark
</span><a href="#local-6989586621679726591"><span class="hs-identifier hs-var">bm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-53"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Benchmark -&gt; BenchmarkInterface
</span><a href="Distribution.Types.Benchmark.html#benchmarkInterface"><span class="hs-identifier hs-var hs-var">PD.benchmarkInterface</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark
</span><a href="#local-6989586621679726591"><span class="hs-identifier hs-var">bm</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-54"></span><span>              </span><span class="annot"><a href="Distribution.Types.BenchmarkInterface.html#BenchmarkExeV10"><span class="hs-identifier hs-type">PD.BenchmarkExeV10</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-55"></span><span>                  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679726588"><span class="annot"><span class="annottext">cmd :: FilePath
</span><a href="#local-6989586621679726588"><span class="hs-identifier hs-var hs-var">cmd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; FilePath
</span><a href="Distribution.Types.LocalBuildInfo.html#buildDir"><span class="hs-identifier hs-var hs-var">LBI.buildDir</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679726604"><span class="hs-identifier hs-var">lbi</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726586"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726586"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; FilePath
</span><a href="Distribution.Simple.BuildPaths.html#exeExtension"><span class="hs-identifier hs-var">exeExtension</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; Platform
</span><a href="Distribution.Types.LocalBuildInfo.html#hostPlatform"><span class="hs-identifier hs-var hs-var">LBI.hostPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679726604"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span>                      </span><span id="local-6989586621679726583"><span class="annot"><span class="annottext">options :: Args
</span><a href="#local-6989586621679726583"><span class="hs-identifier hs-var hs-var">options</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(PathTemplate -&gt; FilePath) -&gt; [PathTemplate] -&gt; Args
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageDescription
-&gt; LocalBuildInfo -&gt; Benchmark -&gt; PathTemplate -&gt; FilePath
</span><a href="Distribution.Simple.Bench.html#benchOption"><span class="hs-identifier hs-var">benchOption</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679726605"><span class="hs-identifier hs-var">pkg_descr</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679726604"><span class="hs-identifier hs-var">lbi</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark
</span><a href="#local-6989586621679726591"><span class="hs-identifier hs-var">bm</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([PathTemplate] -&gt; Args) -&gt; [PathTemplate] -&gt; Args
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-57"></span><span>                                </span><span class="annot"><span class="annottext">BenchmarkFlags -&gt; [PathTemplate]
</span><a href="Distribution.Simple.Setup.html#benchmarkOptions"><span class="hs-identifier hs-var hs-var">benchmarkOptions</span></a></span><span> </span><span class="annot"><span class="annottext">BenchmarkFlags
</span><a href="#local-6989586621679726603"><span class="hs-identifier hs-var">flags</span></a></span><span>
</span><span id="line-58"></span><span>                  </span><span class="hs-comment">-- Check that the benchmark executable exists.</span><span>
</span><span id="line-59"></span><span>                  </span><span id="local-6989586621679726580"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679726580"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726588"><span class="hs-identifier hs-var">cmd</span></a></span><span>
</span><span id="line-60"></span><span>                  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679726580"><span class="hs-identifier hs-var">exists</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; FilePath -&gt; IO ()
forall a. Verbosity -&gt; FilePath -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679726600"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; FilePath -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-61"></span><span>                      </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Error: Could not find benchmark program \&quot;&quot;</span></span><span>
</span><span id="line-62"></span><span>                      </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726588"><span class="hs-identifier hs-var">cmd</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\&quot;. Did you build the package first?&quot;</span></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span>                  </span><span class="annot"><span class="annottext">Verbosity -&gt; FilePath -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#notice"><span class="hs-identifier hs-var">notice</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679726600"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; FilePath -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="#local-6989586621679726576"><span class="hs-identifier hs-var">startMessage</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726586"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-65"></span><span>                  </span><span class="hs-comment">-- This will redirect the child process</span><span>
</span><span id="line-66"></span><span>                  </span><span class="hs-comment">-- stdout/stderr to the parent process.</span><span>
</span><span id="line-67"></span><span>                  </span><span id="local-6989586621679726575"><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679726575"><span class="hs-identifier hs-var">exitcode</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; FilePath -&gt; Args -&gt; IO ExitCode
</span><a href="Distribution.Simple.Utils.html#rawSystemExitCode"><span class="hs-identifier hs-var">rawSystemExitCode</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679726600"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726588"><span class="hs-identifier hs-var">cmd</span></a></span><span> </span><span class="annot"><span class="annottext">Args
</span><a href="#local-6989586621679726583"><span class="hs-identifier hs-var">options</span></a></span><span>
</span><span id="line-68"></span><span>                  </span><span class="annot"><span class="annottext">Verbosity -&gt; FilePath -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#notice"><span class="hs-identifier hs-var">notice</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679726600"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; FilePath -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ExitCode -&gt; FilePath
</span><a href="#local-6989586621679726573"><span class="hs-identifier hs-var">finishMessage</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726586"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679726575"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-69"></span><span>                  </span><span class="annot"><span class="annottext">ExitCode -&gt; IO ExitCode
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679726575"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span>              </span><span class="annot"><span class="annottext">BenchmarkInterface
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-72"></span><span>                  </span><span class="annot"><span class="annottext">Verbosity -&gt; FilePath -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#notice"><span class="hs-identifier hs-var">notice</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679726600"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; FilePath -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;No support for running &quot;</span></span><span>
</span><span id="line-73"></span><span>                      </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;benchmark &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726586"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; of type: &quot;</span></span><span>
</span><span id="line-74"></span><span>                      </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">BenchmarkType -&gt; FilePath
forall a. Pretty a =&gt; a -&gt; FilePath
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Benchmark -&gt; BenchmarkType
</span><a href="Distribution.Types.Benchmark.html#benchmarkType"><span class="hs-identifier hs-var">PD.benchmarkType</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark
</span><a href="#local-6989586621679726591"><span class="hs-identifier hs-var">bm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span>                  </span><span class="annot"><span class="annottext">IO ExitCode
forall a. IO a
</span><a href="../../base/src/System.Exit.html#exitFailure"><span class="hs-identifier hs-var">exitFailure</span></a></span><span>
</span><span id="line-76"></span><span>          </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679726586"><span class="annot"><span class="annottext">name :: FilePath
</span><a href="#local-6989586621679726586"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnqualComponentName -&gt; FilePath
</span><a href="Distribution.Types.UnqualComponentName.html#unUnqualComponentName"><span class="hs-identifier hs-var">unUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">(UnqualComponentName -&gt; FilePath)
-&gt; UnqualComponentName -&gt; FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark -&gt; UnqualComponentName
</span><a href="Distribution.Types.Benchmark.html#benchmarkName"><span class="hs-identifier hs-var hs-var">PD.benchmarkName</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark
</span><a href="#local-6989586621679726591"><span class="hs-identifier hs-var">bm</span></a></span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageDescription -&gt; Bool
</span><a href="Distribution.Types.PackageDescription.html#hasBenchmarks"><span class="hs-identifier hs-var">PD.hasBenchmarks</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679726605"><span class="hs-identifier hs-var">pkg_descr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-79"></span><span>        </span><span class="annot"><span class="annottext">Verbosity -&gt; FilePath -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#notice"><span class="hs-identifier hs-var">notice</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679726600"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Package has no benchmarks.&quot;</span></span><span>
</span><span id="line-80"></span><span>        </span><span class="annot"><span class="annottext">IO ()
forall a. IO a
</span><a href="../../base/src/System.Exit.html#exitSuccess"><span class="hs-identifier hs-var">exitSuccess</span></a></span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageDescription -&gt; Bool
</span><a href="Distribution.Types.PackageDescription.html#hasBenchmarks"><span class="hs-identifier hs-var">PD.hasBenchmarks</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679726605"><span class="hs-identifier hs-var">pkg_descr</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[Benchmark] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Benchmark]
</span><a href="#local-6989586621679726594"><span class="hs-identifier hs-var">enabledBenchmarks</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-83"></span><span>        </span><span class="annot"><span class="annottext">Verbosity -&gt; FilePath -&gt; IO ()
forall a. Verbosity -&gt; FilePath -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679726600"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; FilePath -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;No benchmarks enabled. Did you remember to configure with &quot;</span></span><span>
</span><span id="line-84"></span><span>              </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\'--enable-benchmarks\'?&quot;</span></span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span>    </span><span id="local-6989586621679726562"><span class="annot"><span class="annottext">[Benchmark]
</span><a href="#local-6989586621679726562"><span class="hs-identifier hs-var">bmsToRun</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Args
</span><a href="#local-6989586621679726597"><span class="hs-identifier hs-var">benchmarkNames</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-87"></span><span>            </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Benchmark] -&gt; IO [Benchmark]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[Benchmark]
</span><a href="#local-6989586621679726594"><span class="hs-identifier hs-var">enabledBenchmarks</span></a></span><span>
</span><span id="line-88"></span><span>            </span><span id="local-6989586621679726561"><span class="annot"><span class="annottext">Args
</span><a href="#local-6989586621679726561"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Args -&gt; (FilePath -&gt; IO Benchmark) -&gt; IO [Benchmark]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
t a -&gt; (a -&gt; f b) -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#for"><span class="hs-identifier hs-var">for</span></a></span><span> </span><span class="annot"><span class="annottext">Args
</span><a href="#local-6989586621679726561"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="annot"><span class="annottext">((FilePath -&gt; IO Benchmark) -&gt; IO [Benchmark])
-&gt; (FilePath -&gt; IO Benchmark) -&gt; IO [Benchmark]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679726559"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726559"><span class="hs-identifier hs-var">bmName</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-89"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679726558"><span class="annot"><span class="annottext">benchmarkMap :: [(UnqualComponentName, Benchmark)]
</span><a href="#local-6989586621679726558"><span class="hs-identifier hs-var hs-var">benchmarkMap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[UnqualComponentName]
-&gt; [Benchmark] -&gt; [(UnqualComponentName, Benchmark)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[UnqualComponentName]
</span><a href="#local-6989586621679726557"><span class="hs-identifier hs-var">enabledNames</span></a></span><span> </span><span class="annot"><span class="annottext">[Benchmark]
</span><a href="#local-6989586621679726594"><span class="hs-identifier hs-var">enabledBenchmarks</span></a></span><span>
</span><span id="line-90"></span><span>                    </span><span id="local-6989586621679726557"><span class="annot"><span class="annottext">enabledNames :: [UnqualComponentName]
</span><a href="#local-6989586621679726557"><span class="hs-identifier hs-var hs-var">enabledNames</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Benchmark -&gt; UnqualComponentName)
-&gt; [Benchmark] -&gt; [UnqualComponentName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark -&gt; UnqualComponentName
</span><a href="Distribution.Types.Benchmark.html#benchmarkName"><span class="hs-identifier hs-var hs-var">PD.benchmarkName</span></a></span><span> </span><span class="annot"><span class="annottext">[Benchmark]
</span><a href="#local-6989586621679726594"><span class="hs-identifier hs-var">enabledBenchmarks</span></a></span><span>
</span><span id="line-91"></span><span>                    </span><span id="local-6989586621679726556"><span class="annot"><span class="annottext">allNames :: [UnqualComponentName]
</span><a href="#local-6989586621679726556"><span class="hs-identifier hs-var hs-var">allNames</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Benchmark -&gt; UnqualComponentName)
-&gt; [Benchmark] -&gt; [UnqualComponentName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark -&gt; UnqualComponentName
</span><a href="Distribution.Types.Benchmark.html#benchmarkName"><span class="hs-identifier hs-var hs-var">PD.benchmarkName</span></a></span><span> </span><span class="annot"><span class="annottext">[Benchmark]
</span><a href="#local-6989586621679726596"><span class="hs-identifier hs-var">pkgBenchmarks</span></a></span><span>
</span><span id="line-92"></span><span>                </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
-&gt; [(UnqualComponentName, Benchmark)] -&gt; Maybe Benchmark
forall a b. Eq a =&gt; a -&gt; [(a, b)] -&gt; Maybe b
</span><a href="../../base/src/GHC.List.html#lookup"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; UnqualComponentName
</span><a href="Distribution.Types.UnqualComponentName.html#mkUnqualComponentName"><span class="hs-identifier hs-var">mkUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726559"><span class="hs-identifier hs-var">bmName</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(UnqualComponentName, Benchmark)]
</span><a href="#local-6989586621679726558"><span class="hs-identifier hs-var">benchmarkMap</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-93"></span><span>                    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679726553"><span class="annot"><span class="annottext">Benchmark
</span><a href="#local-6989586621679726553"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Benchmark -&gt; IO Benchmark
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark
</span><a href="#local-6989586621679726553"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-94"></span><span>                    </span><span class="annot"><span class="annottext">Maybe Benchmark
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; UnqualComponentName
</span><a href="Distribution.Types.UnqualComponentName.html#mkUnqualComponentName"><span class="hs-identifier hs-var">mkUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726559"><span class="hs-identifier hs-var">bmName</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName -&gt; [UnqualComponentName] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[UnqualComponentName]
</span><a href="#local-6989586621679726556"><span class="hs-identifier hs-var">allNames</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-95"></span><span>                          </span><span class="annot"><span class="annottext">Verbosity -&gt; FilePath -&gt; IO Benchmark
forall a. Verbosity -&gt; FilePath -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679726600"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO Benchmark) -&gt; FilePath -&gt; IO Benchmark
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Package configured with benchmark &quot;</span></span><span>
</span><span id="line-96"></span><span>                                </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726559"><span class="hs-identifier hs-var">bmName</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; disabled.&quot;</span></span><span>
</span><span id="line-97"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; FilePath -&gt; IO Benchmark
forall a. Verbosity -&gt; FilePath -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679726600"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO Benchmark) -&gt; FilePath -&gt; IO Benchmark
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;no such benchmark: &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726559"><span class="hs-identifier hs-var">bmName</span></a></span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679726550"><span class="annot"><span class="annottext">totalBenchmarks :: Int
</span><a href="#local-6989586621679726550"><span class="hs-identifier hs-var hs-var">totalBenchmarks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Benchmark] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Benchmark]
</span><a href="#local-6989586621679726562"><span class="hs-identifier hs-var">bmsToRun</span></a></span><span>
</span><span id="line-100"></span><span>    </span><span class="annot"><span class="annottext">Verbosity -&gt; FilePath -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#notice"><span class="hs-identifier hs-var">notice</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679726600"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; FilePath -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Running &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679726550"><span class="hs-identifier hs-var">totalBenchmarks</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; benchmarks...&quot;</span></span><span>
</span><span id="line-101"></span><span>    </span><span id="local-6989586621679726547"><span class="annot"><span class="annottext">[ExitCode]
</span><a href="#local-6989586621679726547"><span class="hs-identifier hs-var">exitcodes</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Benchmark -&gt; IO ExitCode) -&gt; [Benchmark] -&gt; IO [ExitCode]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark -&gt; IO ExitCode
</span><a href="#local-6989586621679726592"><span class="hs-identifier hs-var">doBench</span></a></span><span> </span><span class="annot"><span class="annottext">[Benchmark]
</span><a href="#local-6989586621679726562"><span class="hs-identifier hs-var">bmsToRun</span></a></span><span>
</span><span id="line-102"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679726540"><span class="annot"><span class="annottext">allOk :: Bool
</span><a href="#local-6989586621679726540"><span class="hs-identifier hs-var hs-var">allOk</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679726550"><span class="hs-identifier hs-var">totalBenchmarks</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">[ExitCode] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ExitCode -&gt; Bool) -&gt; [ExitCode] -&gt; [ExitCode]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExitCode -&gt; ExitCode -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitSuccess"><span class="hs-identifier hs-var">ExitSuccess</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[ExitCode]
</span><a href="#local-6989586621679726547"><span class="hs-identifier hs-var">exitcodes</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-103"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679726540"><span class="hs-identifier hs-var">allOk</span></a></span><span> </span><span class="annot"><span class="annottext">IO ()
forall a. IO a
</span><a href="../../base/src/System.Exit.html#exitFailure"><span class="hs-identifier hs-var">exitFailure</span></a></span><span>
</span><span id="line-104"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-105"></span><span>    </span><span id="local-6989586621679726576"><span class="annot"><span class="annottext">startMessage :: FilePath -&gt; FilePath
</span><a href="#local-6989586621679726576"><span class="hs-identifier hs-var hs-var">startMessage</span></a></span></span><span> </span><span id="local-6989586621679726538"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726538"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Benchmark &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726538"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;: RUNNING...\n&quot;</span></span><span>
</span><span id="line-106"></span><span>    </span><span id="local-6989586621679726573"><span class="annot"><span class="annottext">finishMessage :: FilePath -&gt; ExitCode -&gt; FilePath
</span><a href="#local-6989586621679726573"><span class="hs-identifier hs-var hs-var">finishMessage</span></a></span></span><span> </span><span id="local-6989586621679726537"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726537"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679726536"><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679726536"><span class="hs-identifier hs-var">exitcode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Benchmark &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679726537"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;: &quot;</span></span><span>
</span><span id="line-107"></span><span>                               </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679726536"><span class="hs-identifier hs-var">exitcode</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-108"></span><span>                                        </span><span class="annot"><span class="annottext">ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitSuccess"><span class="hs-identifier hs-var">ExitSuccess</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;FINISH&quot;</span></span><span>
</span><span id="line-109"></span><span>                                        </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitFailure"><span class="hs-identifier hs-type">ExitFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;ERROR&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span class="hs-comment">-- TODO: This is abusing the notion of a 'PathTemplate'.  The result isn't</span><span>
</span><span id="line-113"></span><span class="hs-comment">-- necessarily a path.</span><span>
</span><span id="line-114"></span><span class="annot"><a href="Distribution.Simple.Bench.html#benchOption"><span class="hs-identifier hs-type">benchOption</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.PackageDescription.html#PackageDescription"><span class="hs-identifier hs-type">PD.PackageDescription</span></a></span><span>
</span><span id="line-115"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.LocalBuildInfo.html#LocalBuildInfo"><span class="hs-identifier hs-type">LBI.LocalBuildInfo</span></a></span><span>
</span><span id="line-116"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.Benchmark.html#Benchmark"><span class="hs-identifier hs-type">PD.Benchmark</span></a></span><span>
</span><span id="line-117"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.InstallDirs.html#PathTemplate"><span class="hs-identifier hs-type">PathTemplate</span></a></span><span>
</span><span id="line-118"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-119"></span><span id="benchOption"><span class="annot"><span class="annottext">benchOption :: PackageDescription
-&gt; LocalBuildInfo -&gt; Benchmark -&gt; PathTemplate -&gt; FilePath
</span><a href="Distribution.Simple.Bench.html#benchOption"><span class="hs-identifier hs-var hs-var">benchOption</span></a></span></span><span> </span><span id="local-6989586621679726534"><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679726534"><span class="hs-identifier hs-var">pkg_descr</span></a></span></span><span> </span><span id="local-6989586621679726533"><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679726533"><span class="hs-identifier hs-var">lbi</span></a></span></span><span> </span><span id="local-6989586621679726532"><span class="annot"><span class="annottext">Benchmark
</span><a href="#local-6989586621679726532"><span class="hs-identifier hs-var">bm</span></a></span></span><span> </span><span id="local-6989586621679726531"><span class="annot"><span class="annottext">PathTemplate
</span><a href="#local-6989586621679726531"><span class="hs-identifier hs-var">template</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-120"></span><span>    </span><span class="annot"><span class="annottext">PathTemplate -&gt; FilePath
</span><a href="Distribution.Simple.InstallDirs.html#fromPathTemplate"><span class="hs-identifier hs-var">fromPathTemplate</span></a></span><span> </span><span class="annot"><span class="annottext">(PathTemplate -&gt; FilePath) -&gt; PathTemplate -&gt; FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PathTemplateEnv -&gt; PathTemplate -&gt; PathTemplate
</span><a href="Distribution.Simple.InstallDirs.html#substPathTemplate"><span class="hs-identifier hs-var">substPathTemplate</span></a></span><span> </span><span class="annot"><span class="annottext">PathTemplateEnv
</span><a href="#local-6989586621679726528"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">PathTemplate
</span><a href="#local-6989586621679726531"><span class="hs-identifier hs-var">template</span></a></span><span>
</span><span id="line-121"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-122"></span><span>    </span><span id="local-6989586621679726528"><span class="annot"><span class="annottext">env :: PathTemplateEnv
</span><a href="#local-6989586621679726528"><span class="hs-identifier hs-var hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageIdentifier
-&gt; UnitId -&gt; CompilerInfo -&gt; Platform -&gt; PathTemplateEnv
</span><a href="Distribution.Simple.InstallDirs.html#initialPathTemplateEnv"><span class="hs-identifier hs-var">initialPathTemplateEnv</span></a></span><span>
</span><span id="line-123"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageDescription -&gt; PackageIdentifier
</span><a href="Distribution.Types.PackageDescription.html#package"><span class="hs-identifier hs-var hs-var">PD.package</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679726534"><span class="hs-identifier hs-var">pkg_descr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; UnitId
</span><a href="Distribution.Types.LocalBuildInfo.html#localUnitId"><span class="hs-identifier hs-var">LBI.localUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679726533"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Compiler -&gt; CompilerInfo
</span><a href="Distribution.Simple.Compiler.html#compilerInfo"><span class="hs-identifier hs-var">compilerInfo</span></a></span><span> </span><span class="annot"><span class="annottext">(Compiler -&gt; CompilerInfo) -&gt; Compiler -&gt; CompilerInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; Compiler
</span><a href="Distribution.Types.LocalBuildInfo.html#compiler"><span class="hs-identifier hs-var hs-var">LBI.compiler</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679726533"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; Platform
</span><a href="Distribution.Types.LocalBuildInfo.html#hostPlatform"><span class="hs-identifier hs-var hs-var">LBI.hostPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679726533"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">PathTemplateEnv -&gt; PathTemplateEnv -&gt; PathTemplateEnv
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-125"></span><span>          </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">PathTemplateVariable
</span><a href="Distribution.Simple.InstallDirs.Internal.html#BenchmarkNameVar"><span class="hs-identifier hs-var">BenchmarkNameVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; PathTemplate
</span><a href="Distribution.Simple.InstallDirs.html#toPathTemplate"><span class="hs-identifier hs-var">toPathTemplate</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; PathTemplate) -&gt; FilePath -&gt; PathTemplate
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName -&gt; FilePath
</span><a href="Distribution.Types.UnqualComponentName.html#unUnqualComponentName"><span class="hs-identifier hs-var">unUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">(UnqualComponentName -&gt; FilePath)
-&gt; UnqualComponentName -&gt; FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark -&gt; UnqualComponentName
</span><a href="Distribution.Types.Benchmark.html#benchmarkName"><span class="hs-identifier hs-var hs-var">PD.benchmarkName</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark
</span><a href="#local-6989586621679726532"><span class="hs-identifier hs-var">bm</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-126"></span></pre></body></html>